package com.enhe.gck.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.kuangkie.carbon.record.Updatable;
import com.kuangkie.carbon.record.annotation.Attribute;
import com.kuangkie.carbon.record.annotation.CarbonRecord;
import com.kuangkie.carbon.record.annotation.RecordCode;
import com.kuangkie.carbon.uid.model.UidManager;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;

// 开票记录
@Data
@CarbonRecord("hwane18525")
public class Invoicing implements Updatable{
    @JSONField(name="唯一编码")
    @RecordCode
    private Long id = UidManager.getLongUID();

    @JSONField(name="作废")
    @Attribute("hwan21399")
    private Boolean isCancel;

    @JSONField(name="命令")
    @Attribute("hwan21400")
    private String command;

    @JSONField(name="备注")
    @Attribute("hwan19856")
    private String remark;


    @JSONField(name="cash")
    @Attribute("hwan21403")
    private Boolean cash;
    @JSONField(name="credit")
    @Attribute("hwan21404")
    private Boolean credit;
    @JSONField(name="totalAmountEXVAT")
    @Attribute("hwan21405")
    private String totalAmountEXVAT;
    @JSONField(name="vATAmount")
    @Attribute("hwan21406")
    private String vATAmount;
    @JSONField(name="totalAmountIncChargeUSD")
    @Attribute("hwan21407")
    private String totalAmountIncChargeUSD;
    @JSONField(name="totalAmountIncChargeCDF")
    @Attribute("hwan21408")
    private String totalAmountIncChargeCDF;

    @JSONField(name="description")
    @Attribute("hwan21442")
    private String description;
    @JSONField(name="quantity")
    @Attribute("hwan21443")
    private String quantity;
    @JSONField(name="amount")
    @Attribute("hwan21444")
    private String amount;
    @JSONField(name="code")
    @Attribute("hwan21477")
    private String code;
    @JSONField(name="unit")
    @Attribute("hwan21478")
    private String unit;
    @JSONField(name="开票开始时间")
    @Attribute("hwan27761")
    private LocalDate startDate;
    @JSONField(name="开票结束时间")
    @Attribute("hwan27762")
    private LocalDate endDate;
    @JSONField(name="税率")
    @Attribute("hwan27763")
    private BigDecimal rate;

    @Override
    public String getRecordCode() {
        return this.id==null ? null : this.id.toString();
    }
}